'''
Created on 2013-5-31

@author: Administrator
'''
#-*-coding:UTF-8-*-
'''
Created on 2013-5-31

@author: Administrator
'''
#第六章
import os

lists = ['a', 'b', 'c']
print lists * 2
print 1 if 3 > 4 else 2
i = 2;
if i > 2:
    print 'yes'
else:
    print 'no'


files = open('e:\\workspace\\mypython\\log.txt','a')
for i in range(10):
    print str(i ** 4)

files.writelines('%s\n' % (str(i ** 4)) for i in range(10));
files.flush()
files.close()

#翻转
print lists[::-1]
print len(lists)
ss = 'abcdefghijk'
print ss[::-1]
print ss[::2]

s = 'abcde'
i = -1
for i in range(-1, -len(s), -1):
    print s[:i]
for i in [None] + range(-1, -len(s), -1):
    print s[:i]
nones = [None]
nones.extend(range(10))
print nones

print list('abced')

print sum([1,23,45])

if 'a' in 'abcd':
    print 'yes'